<template>
	<view class="content">
		<!-- #ifdef MP -->
		<view class="" :style="{'height':navTop+'px'}"></view>
		<!-- #endif -->
		<!-- #ifdef APP-PLUS -->
		<view class="status_bar"></view>
		<!-- #endif -->
		<!-- <view class="navTab">
			<block v-for="(item,index) in scrollList" :key="index">
				<view class="tab-item" :class="{'at-tab-item':current == index}" @click="tabChange(index)">
					{{item.name}}
				</view>
			</block>
			<view class="tab-bottom" :style="[{left:left+'px'},{width:width+'px'}]">
				<view class="xian" :style="{width:width/3+'px'}"></view>
			</view>
		</view> -->
		<swiper class="swiper" :current="current" @change="swiperChange" @animationfinish="animationfinish">
			<swiper-item>
				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="scrolltolower">
					<view class="container" :class="show ? 'fade-in' : 'fade-out'">
						<!-- 搜索框 -->
						<view class="search">
							<view class="left tn-flex tn-flex-col-center" @click="goSelectCity">
								<text class="t1">{{playForm.city}}</text>
								<image src="/static/index/bottom.png" mode=""></image>
							</view>
							<view class="center" @click="tn('/homePages/search')">
								<image :src="imgUrl.indexInput" mode=""></image>
								<input type="text" disabled placeholder="请输入关键词搜索" placeholder-class="pClass" />
							</view>
							<view class="right" @click="gokefu">
								<image src="/static/index/kefu.png" mode=""></image>
							</view>
						</view>

						<view class="" style="padding: 10px 15px;" v-if="swiperList.length>0">
							<tn-swiper :list="swiperList" imageMode="aspectFill" @click="hpicto"
								:height="300"></tn-swiper>
						</view>
						<block
							v-if="configInfo.is_quanzi_fa==1||configInfo.vodindex==1||configInfo.shop_open==1||configInfo.linghunopen==1||configInfo.yuyin_open==1">
							<view class="tab-df">
								<view class="tab-item"
									@click="navigateToFn({ url: '/homePages/party', checkLogin: true })"
									v-if="miniapp_switch == 1">
									<image src="https://peiwanblogs.huolieniaowangluo.com/wx-image/wfw/tab1.png"
										mode=""></image>
									<text>群聊派对</text>
								</view>
								<!--  /minePages/ai 灵魂匹配-->
								<!--								<view class="tab-item"-->
								<!--									@click="navigateToFn({ url: '/minePages/issue', checkLogin: true })">-->
								<!--									<image src="../static/index/tab-1.png"-->
								<!--										mode=""></image>-->
								<!--									<text>快速约玩</text>-->
								<!--								</view>-->



								<!-- 	<view class="tab-item"
									@click="navigateToFn({ url: '/minePages/posts', checkLogin: true })">
									<image src="../static/index/tab-1.png" mode=""></image>
									<text>帖子圈圈</text>
								</view> -->


								<!-- <view class="tab-item" @click="tn('/shopPages/index')">
									<image src="../static/index/tab-2.png" mode=""></image>
									<text>购物商城</text>
								</view>
								<view class="tab-item"
									@click="navigateToFn({ url: '/homePages/huodng', checkLogin: false })">
									<image src="../static/index/tab-3.png" mode=""></image>
									<text>商家活动</text>
								</view>
								<view class="tab-item"
									@click="navigateToFn({ url: '/homePages/addClassify', checkLogin: false })">
									<image src="../static/index/tab-4.png" mode=""></image>
									<text>达人分类</text>
								</view> -->

								<view class="tiezi-section"
									@click="navigateToFn({ url: '/minePages/posts', checkLogin: true })">
									<image src="@/static/index/tiezi-bg.png" mode="aspectFill"></image>
								</view>
								<!-- 改成帖子列表轮播显示 -->
								<view class="scroll-container">
									<view class="scroll-content" style="margin-left: 20rpx;">
										<swiper class="swiper" circular="true" vertical="true"
											display-multiple-items="3" :autoplay="autoplay" :interval="interval"
											:duration="duration">
											<swiper-item class="swiper-item" v-for="(item,index) in goodslist"
												:key="index">
												<view class="n-goods" @click="toGoodDetail(item.id)">
													<image class="n-goods-avatar" :src="item.userAvatar"
														mode="aspectFill">
													</image>
													<view class="n-goods-user">
														<text class="name">{{item.nickname}}</text>
														<view class="type-time">
															<text class="time">{{item.content}}</text>
														</view>
													</view>
												</view>
											</swiper-item>
										</swiper>

									</view>
								</view>
							</view>
						</block>
						<view class="notice">
							<view class="n-left">
								<!-- <image class="n-left-avatar" :src="newestGiftObj.avatar" mode="">
								</image>
								<view class="n-left-user">
									<text class="name">{{newestGiftObj.nickname}}</text>
									<view class="type-time">
										<text class="time">{{newestGiftObj.create_time}}购买了</text>
										<view class="type">{{newestGiftObj.title}}</view>
									</view>
								</view> -->
								<view class="scroll-container hd-scroll-container">
									<view class="scroll-content">
										<swiper class="swiper" circular="true" vertical="true"
											display-multiple-items="6" :autoplay="autoplay" :interval="interval"
											:duration="duration">
											<swiper-item class="swiper-item" v-for="(item,index) in activelist"
												:key="index">
												<view class="n-goods hd-goods" @click="toActiveDetail(item.id)">
													<!-- <image class="n-goods-avatar" :src="item.userAvatar" mode="aspectFill">
													</image> -->
													<view class="n-goods-user">
														<!-- <text class="name">{{item.nickname}}</text> -->
														<view class="type-time hd-title">
															<text class="time">{{item.title}}</text>
														</view>
													</view>
												</view>
											</swiper-item>
										</swiper>
									</view>
								</view>

							</view>
							<view class="n-right" @click="goRankingList">
								<!-- <text>排行榜</text> -->
								<!-- <image src="https://peiwanblogs.huolieniaowangluo.com/wx-image/wfw/jiangbei.png"
									mode=""></image> -->
							</view>
						</view>
						<view class="tn-flex tn-flex-row-between tn-margin-sm"
							v-if="roomlist.length>0 && miniapp_switch == 1">
							<view class="justify-content-item tn-text-bold tn-text-xl">
								<text class="classify-title">派对房间</text>
							</view>
							<view class="justify-content-item tn-text-lg"
								@click="navigateToFn({ url: '/homePages/party', checkLogin: false })">
								<text class="classify-ftitle">更多</text>
								<text class="tn-icon-right classify-icon"></text>
							</view>
						</view>
						<!-- 比例 start-->
						<view class="tn-flex tn-flex-wrap tn-margin-sm room-list" v-if="miniapp_switch == 1">
							<block v-for="(item, indexdroom) in roomlist" :key="indexdroom">
								<view class="tn-padding-xs tn-padding-bottom " style="width: 50%;"
									@click="jinruroom(item.id)">
									<view
										class="tn-blogger-content__wrap tn-flex tn-flex-direction-column tn-flex-row-between">

										<view class="dk-tags" style="background-color: rgba(29, 29, 29, 0.4);">
											<text class="tn-icon-voice"></text>
											{{item.type}}
										</view>
										<view class="name-avatar">
											<text
												class="tn-blogger-content__label__desc  dk-text-over2 ">{{ item.title }}</text>
											<view
												class="tn-flex tn-flex-row-between tn-flex-col-center  tn-padding-right-sm tn-padding-bottom-sm"
												style="height: 35px;">
												<view class="justify-content-item tn-flex tn-flex-col-center">
													<view>
														<tn-avatar-group :lists="item.viewUser.latestUserAvatar"
															size="sm">
														</tn-avatar-group>
													</view>
													<text
														class="tn-color-white tn-text-xs">{{ item.viewUser.viewUserCount }}人在线</text>
												</view>
											</view>
										</view>
									</view>

								</view>
							</block>
						</view>
						<view>
						</view>
						<!-- 达人推荐 -->
						<view class="tn-flex tn-flex-col-center tn-flex-row-between padding-left-right">
							<text class="classify-title">达人</text>
							<view class="classify-right tn-flex tn-flex-col-center">
								<view class="filtrate-book tn-flex tn-flex-col-center" @click="sexShow = true">
									<text class="label-sex">性别：</text>
									<text class="label-value">{{playForm.sexName}}</text>
									<!--									<image class="sanjiao" :src="imgUrl.filtrate" mode=""></image>-->
									<image src="/static/index/sj1.png" style="width: 10px;height: 6px;" mode=""></image>
								</view>
								<view class="filtrate-book tn-flex tn-flex-col-center" @click="priceShow = true">
									<text class="label-sex">价格：</text>
									<text class="label-value">{{playForm.price_name}}</text>
									<!--<image class="sanjiao" :src="imgUrl.filtrate" mode=""></image>-->
									<image src="/static/index/sj1.png" style="width: 10px;height: 6px;" mode=""></image>

								</view>
								<image :src="imgUrl.filtrate" class="shaixuan" @click="zShow = !zShow" mode=""></image>
								<view
									class="filtrate-kuai tn-flex tn-flex-direction-column tn-flex-col-center tn-flex-row-around"
									v-show="zShow">
									<block v-for="(item,index) in zList" :key="index">
										<text :class="[{'text-pitch':zIndex == index}]"
											@click="smartFil(index)">{{item}}</text>
									</block>
								</view>
							</view>
						</view>
						<view class="manito-list padding-left-right">
							<manito-list :list="playList"></manito-list>
						</view>

						<w-load-more ref="wLoadMore"></w-load-more>
						<view class="goto-dr-apply">
							<view class="goto-btn"
								@click="navigateToFn({ url: '/playcenterPage/manito-zheng?type=0', checkLogin: false })">
								想认证成为达人吗？点击进入申请
							</view>
						</view>
					</view>

				</scroll-view>
			</swiper-item>
			<!-- <swiper-item>
				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="scrolltolower1">
					<view class="manito-list padding-left-right">
						<manito-list :list="hotPlayList"></manito-list>
					</view>
					<w-load-more ref="wLoadMore1"></w-load-more>
				</scroll-view>
			</swiper-item>
			<swiper-item>
				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="scrolltolower2">
					<view class="manito-list padding-left-right">
						<manito-list :list="nearbyPlayList"></manito-list>
					</view>
					<w-load-more ref="wLoadMore2"></w-load-more>
				</scroll-view>
			</swiper-item> -->

		</swiper>
		<!-- 登录框组件 -->
		<!-- <login-fn :is-show-login="loginBoxFlag" @loginSuccessCallback="refreshFn" @close="closeGlobalLoginFn">
		</login-fn> -->
		<!-- 压屏窗-->
		<!-- <tn-landscape :show="tanchuangshow" :maskCloseable="false" closePosition="rightTop" @close="closeLandscape">
			<image :src="tanchuanglistimage" mode="widthFix"></image>
		</tn-landscape> -->
		<!-- 性别 -->
		<tn-popup v-model="sexShow" mode="bottom">
			<view class="sexShow tn-flex tn-flex-direction-column tn-flex-row-between">
				<view class="title">性别</view>
				<view class="option tn-flex tn-flex-row-between">
					<block v-for="(item,index) in sexList" :key="index">
						<view class="li" :class="[{'li-pitch':sexIndex == index}]" @click="selectSex(index,item)">
							{{item}}
						</view>
					</block>
				</view>
			</view>
		</tn-popup>
		<!-- 价格 -->
		<tn-popup v-model="priceShow" mode="bottom">
			<view class="sexShow tn-flex tn-flex-direction-column tn-flex-row-between">
				<view class="title">价格</view>
				<view class="option tn-flex tn-flex-row-between">
					<block v-for="(item,index) in priceList" :key="index">
						<view class="li" :class="[{'li-pitch':priceIndex == index}]" @click="selectPrice(index,item)">
							{{item.name}}
						</view>
					</block>
				</view>
			</view>
		</tn-popup>

		<tn-modal v-model="qsnShow" :custom="true" :maskCloseable="false">
			<view class="custom-modal-content">
				<view class="qsn-icon">
					<image src="@/static/qsn.png" mode="aspectFill"></image>
				</view>
				<view class="qsn-guide">为呵护未成年人健康成长，海豚圈圈特别推出青少年模式，该模式下所有功能无法正常使用。请监护人主动选择，并设置监护密码。（我的->设置->青少年模式）</view>
				<view class="goto-model">
					<view class="goto-btn"
						@click.stop="navigateToFn({url:'/minePages/adolescentModel/index',checkLogin:false})">
						进入青少年模式 >
					</view>
				</view>
				<view class="tn-use-modal-btn-row">
					<tn-button class="tn-use-modal-confirm" @click="handleTnUseModalConfirm">我知道了</tn-button>
				</view>
			</view>
		</tn-modal>
	</view>
</template>

<script>
	import {
		host,
		GDWEBKEY,
		iosAppStore
	} from '@/siteinfo.js'
	import silenceUpdate from '@/uni_modules/rt-uni-update/js_sdk/silence-update.js' //引入静默更新
	// import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	// import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins.js';
	export default {
		// mixins: [template_page_mixin, MescrollMixin],
		data() {
			return {
				imgUrl: this.$imgs,
				tanchuanglistimage: '',
				list: [{
						name: '最新'
					},
					{
						name: '推荐'
					},
					{
						name: '热评'
					}, {
						name: '点赞'
					}, {
						name: '人气'
					}
				],
				goodslist: [],
				activelist: [],
				sexList: ['不限', '男', '女'],
				sexIndex: 0,
				sexShow: false,
				priceShow: false,
				priceList: [{
					name: '不限',
					value: ''
				}, {
					name: '从高到低',
					value: 'desc'
				}, {
					name: '从低到高',
					value: 'asc'
				}],
				priceIndex: 0,
				zList: [],
				zIndex: 0,
				zShow: false,
				barStyle: {
					boxShadow: `12rpx 12rpx 16rpx #01BEFF`
				},
				show_fabu: false,
				loading: true,
				loginBoxFlag: false, // 登录框显示隐藏状态
				swiperList: [],
				current: 0,
				currenttiezi: 0,
				scrollList: [{
						name: '首页'
					},
					// {
					// 	name: '热门',
					// },
					// {
					// 	name: '附近'
					// },
				],
				latestUserAvatar: [],
				content: [],
				roomlist: [],
				tanchuangshow: false,
				msgcount: 0,
				left: 0,
				width: 0,
				itemNode: '',
				show: false,
				navTop: 0, //微信小程序胶囊按钮top
				playForm: {
					price_sort: '',
					price_name: '不限',
					sort: 1,
					page: 1,
					lng: '',
					lat: '',
					city: '请选择',
					sex: 0,
					sexName: '不限'
				},
				playForm1: {
					price_sort: '',
					price_name: '不限',
					sort: 3,
					page: 1,
					lng: '',
					lat: '',
					city: '请选择',
					sex: 0,
					sexName: '不限'
				},
				playForm2: {
					price_sort: '',
					price_name: '不限',
					sort: 4,
					page: 1,
					lng: '',
					lat: '',
					city: '请选择',
					sex: 0,
					sexName: '不限'
				},
				playList: [], //大神列表
				hotPlayList: [], //大神列表热门
				nearbyPlayList: [], //大神列表附近
				Jid: '',
				newestGiftObj: '',
				num: 1,
				jId: "",
				miniapp_switch: 0,
				isAuditVersion: getApp().globalData.isAuditVersion,
				qsnShow: false,

				autoplay: true,
				interval: 1500,
				duration: 2900,
			}
		},
		onShareAppMessage(res) {
			return {
				title: this.item.share_title, //分享的名称
				path: '/circlePages/details?id=' + this.id + '&daren_id=' + uni.getStorageSync('user_id'),
			}
		},
		//分享到朋友圈
		onShareTimeline(res) {
			return {
				title: this.item.share_title, //分享的名称
				path: '/circlePages/blogger_other?id=' + this.id + '&daren_id=' + uni.getStorageSync('user_id'),
			}
		},
		onLoad(option) {
			uni.showLoading();
			// 青少年模式是打开的
			if (getApp().hasOpneAdolescentModel(true)) return


			// #ifdef MP
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
			console.log(menuButtonInfo.top)
			this.navTop = menuButtonInfo.top
			// #endif
			if (option.daren_id) {
				uni.setStorageSync('daren_id', option.daren_id)
			}

			/**
			 * @isConnected 当前是否有网络连接
			 * @networkType 网络类型
			 */
			uni.onNetworkStatusChange((res) => {
				if (res.isConnected) {
					this.handleInit()

					// 获取最新礼物记录
					// this.newestGift()
					// this.getActiveList()
				}
			})

			// ios首次安装应用，用户还未允许网络访问
			uni.getNetworkType({
				success: (res) => {
					if (res.networkType != 'none') {
						this.handleInit()
					}
				}
			})
		},
		onShow() {
			// 青少年模式是打开的
			if (getApp().hasOpneAdolescentModel(true)) return
			// ios首次安装应用，用户还未允许网络访问
			uni.getNetworkType({
				success: (res) => {
					if (res.networkType != 'none') {
						// 获取最新礼物记录
						// this.newestGift()
						// this.getActiveList()
					}
				}
			})
		},
		onUnload() {
			uni.offNetworkStatusChange(() => {})
		},
		onReady() {
			const query = uni.createSelectorQuery().in(this);
			query.selectAll('.tab-item').boundingClientRect(data => {
				this.itemNode = data
				this.left = data[this.current].left
				this.width = data[this.current].width
			}).exec();
		},
		methods: {
			toGoodDetail(id) {
				uni.navigateTo({
					url: '/circlePages/details?id=' + id
				});
			},
			handleInit() {
				this.InitLoadingPage()

				setTimeout(() => {
					this.hotNearbyPage()
				}, 500)

				uni.$off('setLoginBoxFlag_home');
				uni.$on('setLoginBoxFlag_home', loginBoxFlag => {
					this.loginBoxFlag = loginBoxFlag;
				});
				uni.$on('jianshacount', (shu) => {
					if (shu == 10000) {
						this.msgcount++
						this.msggai(this.msgcount)
					} else if (this.msgcount > 0 || shu > 0) {
						this.msgcount = this.msgcount - shu
						this.msggai(this.msgcount)
					}

				});
				// 注册接受消息监听
				uni.$on('index', (message) => {
					uni.$emit('jianshacount', 10000)
				});

				this.getAudit()

				//#ifdef APP-PLUS
				this.$nextTick(() => {
					this.gengxin()
				})
				//#endif
				this.GetConfig()

				// 青少年模式只会在首次安装App是弹框提示
				const _qsnModelShow = uni.getStorageSync("qsnModelShow")
				if (!_qsnModelShow) {
					this.qsnShow = true
				}

			},
			async GetConfig() {
				let res = await this.$request({
					method: 'post',
					url: '/api/index/GetConfig'
				})
				this.miniapp_switch = res.data.data.miniapp_switch
			},

			// 针对ios audit mode
			async getAudit() {
				let result = await this.$request({
					method: 'get',
					url: '/api/payment/isEnablePayment'
				})
				if (result.data && result.data.data) {
					getApp().globalData['is_audit_mode'] = result.data.data.is_enable == 1
				} else {
					getApp().globalData['is_audit_mode'] = true
				}
			},


			GDAPI(lng, lat) {
				uni.request({
					url: 'https://restapi.amap.com/v3/geocode/regeo?parameters',
					method: "GET",
					data: {
						key: GDWEBKEY,
						location: `${lng},${lat}`
					},
					success: (res) => {
						if (res.data.status == 1) {
							this.playForm.city = res.data.regeocode.addressComponent.city
						} else {
							// uni.showModal({
							// 	title: '提示',
							// 	content: '获取地理位置失败，请手动选择',
							// 	success: (res) => {
							// 		if (res.confirm) {
							// 			this.goSelectCity()
							// 		} else if (res.cancel) {
							// 			console.log('用户点击取消');
							// 		}
							// 	}
							// });
						}
					}
				})
			},
			// 合并多个请求
			InitLoadingPage() {
				const promiseArr = [this.info(), this.msgcoutget(), this.playIndex(), this.getGoodsList(), this
					.getActiveList()
				]
				Promise.all(promiseArr).then(resArr => {
					this.renderPage(resArr)
				}).catch(err => {
					uni.showToast({
						title: err.data.msg,
						icon: 'none'
					})
					console.log(err)
				})
			},
			// 热门 附近
			hotNearbyPage() {
				const promiseArr = [this.playIndex1(), this.playIndex2()]
				Promise.all(promiseArr).then(resArr => {
					let res1 = resArr[0]
					let res2 = resArr[1]
					// 热门
					this.hotPlayList = res1.data.data
					// 附近
					this.nearbyPlayList = res2.data.data
				}).catch(err => {
					console.log(err)
				})
			},


			renderPage([res1, res2, res3, res4, res5]) {
				// api-index
				this.readInfo(res1)
				// api-getmsgcount
				this.msgcount = res2.data.msg
				this.msggai(this.msgcount)
				// api-play_index
				this.playList = res3.data.data
				this.goodslist = res4.data.data.data
				this.activelist = res5.data.data.data
				this.show = true
				uni.hideLoading()
			},

			// 首页大神下拉加载
			scrolltolower() {
				if (this.playList.length < 20) {
					this.$refs['wLoadMore'].setNomore()
					return
				}
				this.$refs['wLoadMore'].setLoading()
				clearTimeout(this.Jid)
				this.Jid = setTimeout(() => {
					this.playForm.page++
					this.bottomLoadingApi()
				}, 1000)
			},
			// 大神热门
			// scrolltolower1() {
			// 	if (this.hotPlayList.length < 20) {
			// 		this.$refs['wLoadMore1'].setNomore()
			// 		return
			// 	}
			// 	this.$refs['wLoadMore1'].setLoading()
			// 	clearTimeout(this.Jid)
			// 	this.Jid = setTimeout(async () => {
			// 		this.playForm1.page++
			// 		let result = await this.playIndex1()
			// 		let data = result.data.data
			// 		this.hotPlayList = this.hotPlayList.concat(data)
			// 		this.$refs['wLoadMore1'].setNomore()
			// 		if (data.length == 0) {
			// 			this.playForm1.page--
			// 		}
			// 	}, 1000)
			// },
			// // 大神附近
			// scrolltolower2() {
			// 	if (this.nearbyPlayList.length < 20) {
			// 		this.$refs['wLoadMore2'].setNomore()
			// 		return
			// 	}
			// 	this.$refs['wLoadMore2'].setLoading()
			// 	clearTimeout(this.Jid)
			// 	this.Jid = setTimeout(async () => {
			// 		this.playForm2.page++
			// 		let result = await this.playIndex2()
			// 		let data = result.data.data
			// 		this.nearbyPlayList = this.nearbyPlayList.concat(data)
			// 		this.$refs['wLoadMore2'].setNomore()
			// 		if (data.length == 0) {
			// 			this.playForm2.page--
			// 		}
			// 	}, 1000)
			// },
			info() {
				return this.$request({
					loading: 0,
					method: 'post',
					url: '/api/index/index',
					data: {
						type: 1
					}
				})
			},
			msgcoutget() {
				return this.$request({
					loading: 0,
					method: 'post',
					url: '/api/index/getmsgcount',
					data: {}
				});
			},
			// 大神列表
			playIndex(loading) {
				return this.$request({
					loading,
					method: 'post',
					url: '/api/play_index/index',
					data: {
						...this.playForm
					}
				})
			},
			//帖子最新20条（已审核）
			getGoodsList(loading) {
				return this.$request({
					loading,
					method: 'post',
					url: '/api/goods/list',
					data: {
						limit: 20
					}
				})
			},
			getActiveList(loading) {
				return this.$request({
					loading,
					method: 'post',
					url: '/api/index/allActiveList',
					data: {
						page: 1,
						type: 'index'
					}
				})
			},
			//活动最新20条（已审核）
			// async getActiveList(loading) {
			// 	try {
			// 		let result = await this.$request({
			// 			loading,
			// 			method: 'post',
			// 			url: '/api/index/allActiveList',
			// 			data: {
			// 				page: 1,
			// 				type: 'index'
			// 			}
			// 		})
			// 		this.activelist = result.data.data.data
			// 		console.log('active list');
			// 		console.log(result.data.data.data)
			// 	} catch (e) {}
			// },
			// 最新礼物记录
			async newestGift(loading) {
				try {
					let result = await this.$request({
						loading,
						method: 'post',
						url: '/api/gift/newest_gift',
					})
					this.newestGiftObj = result.data.data
				} catch (e) {}

			},
			// 大神列表 热门
			playIndex1(loading) {
				return this.$request({
					loading,
					method: 'post',
					url: '/api/play_index/index',
					data: {
						...this.playForm1
					}
				})

			},
			// 大神列表 附近
			playIndex2(loading) {
				return this.$request({
					loading,
					method: 'post',
					url: '/api/play_index/index',
					data: {
						...this.playForm2
					}
				})

			},

			async filLoadPlayApi() {
				this.playForm.page = 1
				let result = await this.playIndex(1)
				this.playList = result.data.data

			},
			// 下拉加载大神列表
			async bottomLoadingApi() {
				let result = await this.playIndex()
				let data = result.data.data
				this.playList = this.playList.concat(data)
				this.$refs['wLoadMore'].setNomore()
				if (data.length == 0) {
					this.playForm.page--
				}
			},
			// 选择性别
			selectSex(index, name) {
				this.sexIndex = index
				this.playForm.sex = index
				this.playForm.sexName = name
				this.filLoadPlayApi()
				this.sexShow = false

			},
			// 选择价格
			selectPrice(index, item) {
				this.priceIndex = index
				this.playForm.price_sort = item.value
				this.playForm.price_name = item.name
				this.filLoadPlayApi()
				this.priceShow = false

			},
			// 智能筛选
			smartFil(index) {
				this.zIndex = index
				this.playForm.sort = index += 1
				this.filLoadPlayApi()
				this.zShow = false

			},
			goSelectCity() {
				getApp().handleSysGetLocation().then(res => {
					this.playForm.lat = res.latitude
					this.playForm.lng = res.longitude
					uni.setStorageSync('lat', res.latitude);
					uni.setStorageSync('lng', res.longitude);

					// this.InitLoadingPage()
					// #ifdef APP-PLUS
					this.playForm.city = res.address.city
					// #endif
					// #ifndef APP-PLUS
					this.GDAPI(res.longitude, res.latitude)
					// #endif
				}).finally(() => {
					uni.navigateTo({
						url: '/homePages/selectCity',
						events: {
							getLocation: (data) => {
								this.playForm = {
									...this.playForm,
									...data
								}
								this.playForm.page = 1
								this.filLoadPlayApi()
							}
						}
					})
				})
			},
			swiperChange(e) {
				console.log(e)
				let {
					current
				} = e.detail
				this.current = current
				this.left = this.itemNode[current].left
			},
			transition(e) {
				if (this.current == 2) {
					clearTimeout(this.jId)
					this.jId = setTimeout(() => {
						this.num++
						console.log(this.num, 'this.numthis.numthis.num')
						if (this.num == 3) {
							uni.switchTab({
								url: "/pages/circle/circle",
								success: () => {
									this.num = 1
								}
							})
						}
					}, 100)

				}

			},
			animationfinish(e) {
				console.log(e.detail)

				// this.playIndex()
				// this.playIndex1()
				// this.playIndex2()
			},
			async readInfo(result) {
				let that = this;
				let resultData = result.data.data
				that.swiperList = resultData.swiperList;
				that.roomlist = resultData.roomlist;
				that.tanchuanglist = resultData.tanchuanglist[0];
				if (resultData.tanchuanglist.length > 0) {
					that.tanchuangshow = true
					that.tanchuanglistimage = that.tanchuanglist.image
				}
				that.loading = false
				if (resultData.is_openweb == 0) {
					uni.showModal({
						title: '提示',
						content: resultData.is_openwebtishi,
						showCancel: false,
						success: (res) => {
							if (res.confirm) {

								// #ifdef APP-PLUS
								uni.getSystemInfo({
									success: function(res) {
										if (res.platform == 'android') {
											plus.runtime.quit();
										} else {
											plus.ios.import("UIApplication")
												.sharedApplication().performSelector(
													"exit");
										}
									}
								});
								// #endif
								// #ifdef MP||H5
								uni.reLaunch({
									url: '/pages/index/index'
								})
								// #endif
							}
						}
					})

				}

			},
			// tab选项卡切换
			tabChange(index) {
				this.current = index
				this.left = this.itemNode[index].left
			},
			// 客服
			gokefu() {
				uni.navigateTo({
					url: `/minePages/chat/talkkefu?toid=1&toname=官方客服`
				})
			},
			toActiveDetail(id) {
				uni.navigateTo({
					url: '/circlePages/reserve?id=' + id
				});
			},
			// 跳转
			tn(e) {
				uni.navigateTo({
					url: e,
				});
			},
			goRankingList() {
				uni.navigateTo({
					url: "/playcenterPage/ranking-list"
				})
			},
			// 关闭压屏窗
			closeLandscape() {
				this.tanchuangshow = false
				this.show_fabu = false
			},
			hpicto(index) {
				if (this.swiperList[index].url && this.swiperList[index].leixing == 0) {
					this.tn('/circlePages/details?id=' + this.swiperList[index].url + '')
				}
				if (this.swiperList[index].url && this.swiperList[index].leixing == 1) {
					this.tn('/circlePages/group?id=' + this.swiperList[index].url + '')
				}
				if (this.swiperList[index].url && this.swiperList[index].leixing == 2) {

					// #ifdef APP-PLUS
					this.navigateToFn({
						url: '/minePages/chat/room?id=' + this.swiperList[index].url,
						checkLogin: true
					})
					// #endif
					// #ifndef APP-PLUS
					this.navigateToFn({
						url: '/minePages/chat/room_text?id=' + this.swiperList[index].url,
						checkLogin: true
					})
					// #endif

				}
				if (this.swiperList[index].url && this.swiperList[index].leixing == 4) {
					this.tn('/shopPages/product?id=' + this.swiperList[index].url + '')
				}
				if (this.swiperList[index].url && this.swiperList[index].leixing == 5) {
					this.tn('/homePages/about?id=' + this.swiperList[index].url + '')
				}

			},
			tanchuang() {
				if (this.tanchuanglist.url) {
					this.tn('/circlePages/details?id=' + this.tanchuanglist.url + '')
				}
			},
			refreshFn() {

			},
			jinruroom(id) {
				// #ifdef APP-PLUS
				this.navigateToFn({
					url: '/minePages/chat/room_text?id=' + id,
					checkLogin: true
				})
				// #endif
				// #ifndef APP-PLUS
				this.navigateToFn({
					url: '/minePages/chat/room_text?id=' + id,
					checkLogin: true
				})
				// #endif
			},


			tabsChange(index) {
				this.currenttiezi = index
				this.mescroll.resetUpScroll()
			},

			msggai(shuzi) {
				console.log(9999)
				console.log(shuzi)
				// #ifdef APP||H5
				if (shuzi <= 0) {
					uni.removeTabBarBadge({
						index: 3
					}); //移除条数
				} else {
					uni.setTabBarBadge({
						index: 3,
						text: `${shuzi}`
					});
				}
				// #endif

				// #ifdef MP
				if (shuzi <= 0) {
					uni.removeTabBarBadge({
						index: 3
					}); //移除条数
				} else {
					uni.setTabBarBadge({
						index: 3,
						text: `${shuzi}`
					});
				}
				// #endif
			},

			gengxin() {
				// 安卓更新：获取本地应用资源版本号，在管理后台-配置管理-基本配置-APP设置-设置安卓最新版本
				plus.runtime.getProperty(plus.runtime.appid, (inf) => {
					uni.request({
						url: host + '/api/index/app_up',
						data: {
							edition_type: plus.runtime.appid,
							version_type: uni.getSystemInfoSync().platform,
							edition_number: inf.versionCode
						},
						success: (res) => {
							console.log('【接口返回版本信息】', res.data.data)
							console.log('【当前app版本号】', inf.versionCode)

							// 确定是不是审核版本
							if (Number(res.data.data
									.edition_number) == Number(inf
									.versionCode)) {
								getApp().globalData.isAuditVersion = true
								this.isAuditVersion = true
								this.zList = ['智能排序', '人气优先']
							} else {
								getApp().globalData.isAuditVersion = false
								this.isAuditVersion = false
								this.zList = ['智能排序', '距离优先', '人气优先']
							}

							console.log('=是否审核版本=', getApp().globalData.isAuditVersion)

							/**
							 * @edition_issue 是否发行，0-否 1-是，为了控制上架应用市场审核时不能弹出热更新框
							 * @edition_silence 是否静默更新 0-否 1-是
							 */
							if (Number(res.data.data.edition_number) > Number(inf.versionCode) && res
								.data.data.edition_issue == 1) {

								if (this.$isIos) {
									if (!getApp().globalData.is_audit_mode) {
										plus.runtime.openURL(iosAppStore);
									}
									return
								}

								// 静默更新
								if (res.data.data.package_type == 1 && res.data.data.edition_silence ==
									1) {
									silenceUpdate(res.data.data.edition_url)
								} else {
									// 强制更新
									//跳转更新页面 （注意！！！如果pages.json第一页的代码里有一打开就跳转其他页面的操作，下面这行代码最好写在setTimeout里面设置延时3到5秒再执行）
									uni.navigateTo({
										url: '/uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update?obj=' +
											JSON.stringify(res.data.data)
									});
								}
							}
						}
					})
				});
			},
			handleTnUseModalConfirm() {
				uni.setStorageSync("qsnModelShow", true)
				this.qsnShow = false
			}
		}
	}
</script>
<style lang="scss">
	/* #ifdef APP-PLUS */
	.status_bar {
		height: var(--status-bar-height);
		width: 100%;
	}

	/* #endif */
	page {
		background: #ffffff;
	}
</style>
<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		height: 100vh;
		background: url("../static/top-bg.png") no-repeat;
		background-size: 100% 250px;

		.swiper {
			flex: 1;

			.scroll-view {
				height: 100%;
			}
		}

		.container {
			height: 100%;
		}
	}

	.padding-left-right {
		padding: 0 30rpx;
	}

	.classify-title {
		font-size: 40rpx;
		font-weight: bold;
		color: $uni-text-color;
	}

	.classify-ftitle {
		font-size: 28rpx;
		font-weight: 400;
		color: #CCCCCC;
	}

	.classify-icon {
		color: #CCCCCC;
		font-size: 24rpx;
	}

	// 头部切换
	.navTab {
		display: flex;
		align-items: center;
		height: 88rpx;
		padding-left: 30rpx;
		position: relative;

		.tab-item {
			font-size: 32rpx;
			font-weight: 400;
			color: #333333;
			margin-right: 56rpx;
		}

		.at-tab-item {
			font-size: 36rpx;
			font-weight: bold;
			color: $uni-text-color;
		}

		.tab-bottom {
			position: absolute;
			bottom: 0;
			transition: left .2s linear;
			display: flex;
			justify-content: center;

			.xian {
				height: 8rpx;
				background: linear-gradient(90deg, #080808 0%, #080808 100%);
				border-radius: 60rpx;
			}
		}
	}

	// 搜索框
	.search {
		display: flex;
		align-items: center;
		padding: 0 30rpx;
		margin-top: 32rpx;

		.left {
			.t1 {
				font-size: 26rpx;
				font-weight: 500;
				color: $uni-city-text-color;
				margin-right: 10rpx;
			}

			image {
				width: 20rpx;
				height: 11rpx;
			}
		}

		.center {
			flex: 1;
			height: 72rpx;
			background: $uni-input-bg-color;
			border-radius: 12rpx;
			margin-left: 24rpx;
			margin-right: 16rpx;
			padding: 0 24rpx;
			display: flex;
			align-items: center;

			image {
				width: 24rpx;
				height: 26rpx;
				margin-right: 16rpx;
			}

			.pClass {
				color: $uni-input-placeholder-color;
			}

			input {
				color: $uni-text-color;
			}
		}

		.right {
			image {
				width: 40rpx;
				height: 40rpx;
			}
		}
	}

	.tab-df {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		width: 100%;


		.tab-item {
			display: flex;
			flex-direction: column;

			image {
				width: 98rpx;
				height: 98rpx;
			}

			text {
				font-size: 24rpx;
				color: #5B5B5B;
				margin-top: 10rpx;
			}
		}


		.tiezi-section {
			width: 168rpx;
			height: 360rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}
	}


	.notice {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 32rpx 30rpx 32rpx 30rpx;

		.n-left {
			width: 502rpx;
			height: 360rpx;
			background: url('../static/index/indexBg.png') no-repeat;
			background-size: 100% 100%;
			display: flex;
			align-items: center;
			padding-left: 24rpx;
			color: #fff !important;

			&-avatar {
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
			}

			&-user {
				margin-left: 10rpx;

				.name {
					font-size: 28rpx;
					font-weight: bold;
					color: #FCFFFF;
					margin-bottom: 10rpx;
				}

				.type-time {
					font-size: 22rpx;
					display: flex;
					align-items: center;

					.time {
						color: #FCFFFF;
					}

					.type {
						color: #FFEB45;
						width: 90rpx;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
					}
				}
			}
		}

		.n-right {
			width: 168rpx;
			height: 360rpx;
			background: url('../static/index/indexBg-right2.png') no-repeat;
			background-size: 100% 100%;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;
			padding-top: 24rpx;

			text {
				font-size: 24rpx;
				font-weight: bold;
				color: #fff;
			}

			image {
				width: 114rpx;
				height: 93rpx;
			}
		}
	}

	.room-list {
		.tn-blogger-content__wrap {
			background: url('https://peiwanblogs.huolieniaowangluo.com/wx-image/wfw/roomBg.png') no-repeat;
			background-size: 100% 100%;
			height: 320rpx;

			.name-avatar {
				padding-left: 16rpx;

				.tn-blogger-content__label__desc {
					font-size: 28rpx;
					font-weight: 400;
					color: #FFFFFF;
					margin-bottom: 16rpx;
				}
			}
		}
	}

	.classify-right {
		position: relative;

		.filtrate-book {
			font-size: 14px;
			font-weight: 500;
			color: $uni-filtrate-text-color;
			height: 48rpx;
			background: $uni-filtrate-bg-color;
			border-radius: 24rpx;
			border: 1px solid $uni-filtrate-border-color;
			padding: 0 16rpx;
			margin-left: 24rpx;

			.sanjiao {
				width: 12rpx;
				height: 6rpx;
				margin-left: 10rpx;
			}
		}

		.filtrate-kuai {
			width: 148rpx;
			// height: 210rpx;
			background: #f7f7f7;
			border-radius: 8rpx;
			opacity: 1;
			position: absolute;
			right: -10upx;
			top: 57upx;

			text {
				height: 60rpx;
				line-height: 60rpx;
				font-size: 24rpx;
				font-weight: 500;
				color: #333333d6;
			}

			.text-pitch {
				//color: #fff;
				font-weight: bold;
			}

		}

		.filtrate-kuai::before {
			content: "";
			width: 0px;
			height: 0px;
			border-left: 12rpx solid transparent;
			border-right: 12rpx solid transparent;
			border-bottom: 20rpx solid #f7f7f7;
			position: absolute;
			top: -20rpx;
			right: 10rpx;

		}

		.shaixuan {
			width: 26rpx;
			height: 28rpx;
			margin-left: 16rpx;
		}
	}

	.manito-list {
		margin-top: 32rpx;
	}

	.sexShow {
		background-color: #ffffff;
		padding: 32rpx 30rpx 24rpx 30rpx;

		.title {
			font-size: 32rpx;
			font-weight: 500;
			color: #000000;
			margin-bottom: 24rpx;
		}

		.option {
			.li {
				width: 220rpx;
				height: 68rpx;
				background: #3d7eff;
				border-radius: 37rpx;
				font-size: 28rpx;
				font-weight: 500;
				color: #FFFFFF;
				text-align: center;
				line-height: 68rpx;

			}

			.li-pitch {
				background: linear-gradient(180deg, #F783C3 0%, #A66FF7 100%);
			}
		}
	}




	.dk-tags {
		font-size: 26rpx;
		font-weight: 400;
		color: #FFFFFF;
	}

	/* 文字截取*/
	.clamp-text-1 {
		-webkit-line-clamp: 1;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.clamp-text-2 {
		-webkit-line-clamp: 2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.tn-icon-voice {
		animation: msClock 1.2s linear infinite;
	}

	@keyframes msClock {

		0%,
		90%,
		100% {
			transform: rotate(0) scale(1);
		}

		20%,
		40% {
			transform: rotate(-15deg) scale(1.2);
		}

		30%,
		50% {
			transform: rotate(15deg) scale(1.3);
		}
	}

	.custom-modal-content {
		.qsn-icon {
			width: 120rpx;
			height: 120rpx;
			margin: 0 auto 20rpx auto;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.qsn-guide {
			text-align: justify;
			font-size: 28rpx;
			color: #333333;
		}

		.goto-model {
			display: flex;
			align-items: center;
			justify-content: center;
			text-align: center;
			border-bottom: 1px solid #f1f1f1;
			height: 80rpx;
			line-height: 80rpx;

			.goto-btn {
				font-size: 28rpx;
				line-height: 28rpx;
				color: #98adf9;
				padding: 6rpx 12rpx;
			}
		}

		.tn-use-modal-btn-row {
			text-align: center;

			.tn-use-modal-confirm {
				width: 100% !important;
				margin: 20rpx auto 0 auto;
				color: #53ef5d;
			}
		}
	}

	//dahong
	.scroll-container {
		overflow: hidden;
		position: relative;
		height: 360rpx;
		/* 设置滚动区域的高度 */
		flex: 1;
	}

	.scroll-content {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;

		.swiper-item {
			display: flex;
			align-items: center;
		}
	}

	.n-goods {
		flex: 1;
		height: 100rpx;
		display: flex;
		align-items: center;

		&-avatar {
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
			background-color: #f5f5f5;
		}

		&-user {
			margin-left: 10rpx;

			.name {
				font-size: 28rpx;
				font-weight: bold;
				margin-bottom: 10rpx;
			}

			.type-time {
				font-size: 22rpx;
				display: flex;
				align-items: center;

				.time {
					text-overflow: ellipsis;
					overflow: hidden;
					white-space: nowrap;
					width: 350rpx;
				}
			}

			.hd-title {
				.time {
					width: 420rpx;
				}
			}
		}
	}

	.hd-goods {
		height: 56rpx;
	}

	.goto-dr-apply {
		height: 120rpx;
		display: flex;
		justify-content: center;
		text-align: center;

		.goto-btn {
			font-size: 24rpx;
			color: #892fe8;
			height: 60rpx;
			line-height: 60rpx;
		}
	}
</style>